// https://www.luogu.com.cn/problem/P2142

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

string str1, str2;

void del() {
    bool flag = true;
    if (str1.length() < str2.length()) {
        flag = false;
        swap(str1, str2);
    }

    // 88 - 89 这种情况
    if (str1.length() == str2.length()) {
        for (int i = 0; i < str1.length(); i++) {
            if (str1[i] < str2[i]) {
                flag = false;
                swap(str1, str2);
                break;
            }
        }
    }

    int add = 0;
    int t1 = str1.length() - 1, t2 = str2.length() - 1;
    string ans;
    for (int i = 0; i < str2.length(); i++) {
        int tmp = str1[t1] - str2[t2] + add;
        if (tmp < 0) {
            add = -1;
            tmp += 10;
        } else {
            add = 0;
        }
        ans.push_back(tmp + '0');
        --t1, --t2;
    }

    while (t1 >= 0) {
        int tmp = str1[t1] - '0' + add;
        if (tmp < 0) {
            add = -1;
            tmp += 10;
        } else {
            add = 0;
        }
        ans.push_back(tmp + '0');
        --t1;
    }

    // 100 103
    while (ans.length() > 1 && ans.back()=='0') {
        ans.pop_back();
    }

    reverse(ans.begin(), ans.end());
    // 去除前面的 0

    if (!flag) {
        cout << "-" << ans << endl;
    } else {
        cout << ans << endl;
    }
}


int main() {
    cin >> str1 >> str2;
    del();
    return 0;
}